import React from "react";
import * as UI from "antd-mobile"
import * as ICON from "antd-mobile-icons"
import * as Router from "react-router-dom"
import request from '@/services/request'
import Cookie from 'react-cookies'
React.UI=UI
React.ICON=ICON
React.Router=Router
React.HTTP = request
React.Cookie = Cookie

// 成功提醒方法
React.success = (msg: string, callback?: () => void) => {
    React.UI.Toast.show({
        icon: 'success',
        content: msg,
        duration: 1500,
        afterClose: callback ? callback : () => { }
    })
}


// 失败提醒方法
React.error = (msg: string, callback?: () => void) => {
    React.UI.Toast.show({
        icon: 'fail',
        content: msg,
        duration: 1500,
        afterClose: callback ? callback : () => { }
    })
}